Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: flow for plugin package file mapping and xattr tagging #979

Merged
merged 12 commits into from
Jan 20, 2025

Conversation

mattculler
Copy link
Contributor

  • Have you signed the CLA?
  • Have you added an entry to the changelog (docs/reference/changelog.rst)?

Implement flow code, defined by https://docs.google.com/document/d/1wVtAYJouIXotd8iCZMZ_1VpmGpN0yoLfKcxeOBIgotw/edit?tab=t.0

(CRAFT-3741)

@mattculler mattculler self-assigned this Jan 16, 2025
@mattculler mattculler changed the title Flow for plugin package file mapping and xattr tagging feat: flow for plugin package file mapping and xattr tagging Jan 16, 2025
@mattculler mattculler marked this pull request as ready for review January 16, 2025 18:09
Copy link
Contributor

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, although it's not clear why the integration tests fail. I wonder if github runners support xattrs.

pyproject.toml Outdated Show resolved Hide resolved
@mattculler
Copy link
Contributor Author

Looks good to me, although it's not clear why the integration tests fail. I wonder if github runners support xattrs.

One of the top results on kagi for "github ci runner xattr" was posted by this familiar face:

#661

So it seems I'll need to fix these tests by disabling the plugin xattr writes somehow, I'll investigate more.

Copy link
Collaborator

@cmatsuoka cmatsuoka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! It would be great to adjust the Path parameter if possible, otherwise I think it's doing what it's supposed to do. But please add a description to the PR, we'll want to know what this is about in the future.

@@ -58,7 +60,7 @@ def read_xattr(path: str, key: str) -> str | None:
return value.decode().strip()


def write_xattr(path: str, key: str, value: str) -> None:
def write_xattr(path: str | Path, key: str, value: str) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For general API consistency it would be better to use only Path here, unless convenience suffers too much. Then it would be simpler to test this only with Path instead of testing with str and Path.

@@ -47,6 +47,8 @@

logger = logging.getLogger(__name__)

_ORIGIN_PACKAGE_FORMAT = "origin_{plugin_name}_package"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit strange in isolate form but I see it's following the xattr pattern already used for stage packages.

@@ -1,3 +1,5 @@
# noqa: A005
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this will render the editor modeline below useless.

@sergiusens sergiusens merged commit 7511511 into feature/origin-tagging Jan 20, 2025
8 of 13 checks passed
@sergiusens sergiusens deleted the work/CRAFT-3741-xattr-tagging-flow branch January 20, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants